package com.fozu.office.sale.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fozu.office.sale.dao.AchievementDao;
import com.fozu.office.sale.entity.AchievementVO;
import com.fozu.office.system.entity.UserVO;

/*
 * 销售绩效
 */
@Service("achievementService")
@Transactional(readOnly=true)
public class AchievementServiceImpl {
	@Autowired
	private AchievementDao adao;
	//获取绩效列表
	public IPage<AchievementVO> listAchievement(Page<AchievementVO> age,AchievementVO achievementVO){
		return adao.listAchievement(age, achievementVO);
	}
	@Transactional(readOnly=false)
	public void addMent(AchievementVO achievementVO){
		adao.addMent(achievementVO);
	}
	//根据id批量删除用户(更改status状态)
	@Transactional(readOnly=false)
	public void delMentByIds(String[] ids){
		AchievementVO ment =new AchievementVO();
		for (String id : ids) {
			ment.setId(id);
			adao.delMentByIds(ment);
		}
	}
	//通过Id那对象
	public AchievementVO getMentById(String id){
		return adao.getMentById(id);
	}
	//修改
	@Transactional(readOnly=false)
	public void updateMent(AchievementVO ment){
		adao.updateMent(ment);
	}
}
